/* 全局注册 通用组件 */
import TableView from '@/components/TableView.vue'
import ViewSearchForm from '@/components/ViewSearchForm.vue'
import DialogForm from '@/components/DialogForm.vue'
import SaveButton from '@/components/SaveButton.vue'
import CancelButton from '@/components/CancelButton.vue'
import DeletePopover from '@/components/DeletePopover.vue'
import GoBackButton from '@/components/GoBackButton.vue'
import ToolTipsGroup from '@/components/ToolTipsGroup.vue'
import CommonForm from '@/components/CommonForm.vue'
import PopoverForm from '@/components/PopoverForm.vue'
import UploadSingleImg from '@/components/UploadSingleImg.vue'
import UploadFile from '@/components/UploadFile.vue'
import ImportExcel from '@/components/ImportExcel.vue'

const components = [
    {title: 'TableView', component: TableView},
    {title: 'ViewSearchForm', component: ViewSearchForm},
    {title: 'DialogForm', component: DialogForm},
    {title: 'CommonForm', component: CommonForm},
    {title: 'SaveButton', component: SaveButton},
    {title: 'CancelButton', component: CancelButton},
    {title: 'DeletePopover', component: DeletePopover},
    {title: 'GoBackButton', component: GoBackButton},
    {title: 'ToolTipsGroup', component: ToolTipsGroup},
    {title: 'UploadSingleImg', component: UploadSingleImg},
    {title: 'UploadFile', component: UploadFile},
    {title: 'ImportExcel', component: ImportExcel},
    {title: 'PopoverForm', component: PopoverForm}
]
export default {
    install(app) {
        // 此处形参 app 为main.js文件中use()方法自动传进来的Vue实例
        components.forEach(item => {
            app.component(item.title, item.component)
        })
    }
}
